#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/file.h>
#include <unistd.h>

void is_run() 
{
	FILE *fp;
	int count = 0;

	fp = popen("ps -ef|grep foo1|grep -v grep|wc -l|awk '{print $1}'","r");

	if(fp)
	{
		count = fscanf(fp, "%d",&count);
		fclose(fp);
	}

	if(count > 0)
		printf("foo1 running...\n");
	else
		printf("foo1 not running...\n");

}

void other()
{
	int rs;
	
	rs = system("killall -0 http");
	if(rs == 0){
		//http is running...
	} 
}

void main()
{
	is_run();
}
